package com.zeratul.gateway.application;

import cn.hutool.core.convert.Convert;
import com.zeratul.cloud.base.BaseApplication;
import com.zeratul.gateway.application.prop.ZeratulGatewayProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import reactor.netty.ReactorNetty;

@Slf4j
@SpringBootApplication
@EnableConfigurationProperties(ZeratulGatewayProperties.class)
public class ZeratulGatewayApplication extends BaseApplication {

    public static void main(String[] args) {
        //设置Gateway底层线程池大小
        System.setProperty(ReactorNetty.IO_SELECT_COUNT, Convert.toStr(4));
        System.setProperty(ReactorNetty.IO_WORKER_COUNT, Convert.toStr(Runtime.getRuntime().availableProcessors() * 4));
        run(ZeratulGatewayApplication.class, args);
    }
}
